import 'package:car_map/page/res/styles.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

import 'load_image.dart';
///旅行问答
class WidgetQuestionItem extends StatelessWidget{
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Container(
      margin: EdgeInsets.only(left: 10.0,right: 10.0),
      height: ScreenUtil().setHeight(130.0),
      decoration: BoxDecoration(
        color: Colors.black12,
        borderRadius: BorderRadius.all(Radius.circular(10.0))
      ),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
        crossAxisAlignment: CrossAxisAlignment.center,
        children: <Widget>[
          LoadAssetImage(
            'statistics/ic_question_ing',
            fit: BoxFit.fill,
            width: ScreenUtil().setWidth(90.0),
            height: ScreenUtil().setHeight(90.0),
          ),

          itemQuestion(),
          questionButton(),
        ],
      ),
    );
  }

  Widget itemQuestion(){
    return Container(
      width: ScreenUtil().setWidth(500.0),
      child:  Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
          Row(
            mainAxisAlignment: MainAxisAlignment.start,
            children: <Widget>[
              Icon(Icons.person,size: 30.0,),
              Text('Tom老师',style: TextStyles.textBold14,),
              Text('回答了问题',style: TextStyles.textGray14,),
            ],
          ),
          Text('想去西安赏秋，有银杏叶和红叶看嘛...',style: TextStyle(fontWeight: FontWeight.bold,fontSize: 15.0,),maxLines: 2,),
        ],
      ),
    );
  }

  //我要提问按钮
  Widget questionButton(){
    return Container(
      margin: EdgeInsets.only(right: 10.0),
      width: ScreenUtil().setWidth(90.0),
      height: ScreenUtil().setHeight(90.0),
      alignment: Alignment.center,
      decoration: BoxDecoration(
        color: Colors.yellowAccent,
        borderRadius: BorderRadius.all(Radius.circular(10.0))
      ),
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
          Text('我要',style: TextStyle(fontWeight: FontWeight.bold,fontSize: 16.0),),
          Text('提问',style: TextStyle(fontWeight: FontWeight.bold,fontSize: 16.0)),
        ],
      ),
    );
  }

}